class PaymentType {
  // 现金支付
  static const String cash = 'CASH';

  // 信用卡支付
  static const String creditCard = 'CREDIT_CARD';

  // The data dict for display.
  static Map<String, String> _categories = <String, String>{};

  /// Loads the data when it is not ready yet.
  ///
  /// [loadedPaymentTypes] is the data provided by other service. If this is not null then we don't have to load it again from server.
  static Future<void> init(Map<String, String> loadedPaymentTypes) async {
    _categories = loadedPaymentTypes;
  }

  /// Gets the loaded data.
  static Map<String, String> getCategories() {
    return _categories;
  }

  // Clears cache data.
  static void clearCache() {
    _categories.clear();
  }
}
